<template>
  <ul>
    <li class="findItem" @click="details">
      <div class="findCont">
        <div class="title">
          <p>{{contentItem.seekTitle}}</p>
          <span>{{contentItem.seekTime}}</span>
        </div>
        <div class="price">
           <label>期望地点：<b>{{contentItem.city}}{{contentItem.arer}}</b></label>
           <label>期望面积：<b>{{contentItem.seekAcreageD}}㎡-{{contentItem.seekAcreageU}}㎡</b></label>
          <strong>
            {{contentItem.seekRentD}}元-{{contentItem.seekRentU}}元
            <span>/月</span>
          </strong>
        </div>
        <div class="tag">
          <span class="items" v-for="(info, i) in arrTag" :key="i">{{info.name}}</span>
        </div>
      </div>
    </li>
  </ul>
</template>

<script>
export default {
  props: ["contentItem"],
  data() {
    return {};
  },
  methods: {
    details(){
      window.open('/#/qiuzu/'+ this.contentItem.id)
    },
    partsToArr() {
      var string = this.contentItem.seekParts;
      if (string) {
        let newArr = [];
        let arr = string.split(",");
        for (let i = 0; i < arr.length; i++) {
          newArr.push(this.$store.state.partsArr[arr[i] - 1]);
        }
        return newArr;
      }
    },
  },
  computed: {
    arrTag() {
      return this.partsToArr();
    }
  },
  created() {}
};
</script>
<style scoped lang="less">
.tag {
  margin-top: 10px;
}
.findItem:hover {
  background: #eee;
}
.findItem {
  padding: 20px;
  border-bottom: 1px solid #eee;
  .findCont {
    width: 100%;
  }
  display: flex;
  .title {
    p {
      font-size: 20px;
      overflow: hidden;
      white-space: nowrap; //不换行
      text-overflow: ellipsis;
      height: 40px;
      width: calc(100% - 150px);
    }
    span {
      width: 150px;
      display: block;
      color: #999;
      font-size: 14px;
      text-align: right;
    }
    justify-content: space-between;
    align-items: center;
    display: flex;
  }
  .price {
    display: flex;
    justify-content: space-between;
    b {
      font-size: 20px;
    }
    strong{
      font-size: 28px;
      color: #ff5001;
      font-weight: normal;
    }
  }

  .el-image {
    width: 200px;
    height: 150px;
  }
  .items {
    background: #feddcc;
    margin-right: 10px;
    font-size: 12px;
    color: #ff5001;
    padding:3px 5px;
  }
}
</style>
